<!--
 * @Author: qwlbwm 18370818801qwl./
 * @Date: 2023-09-06 12:20:19
 * @LastEditors: whereamazinghappen 306702547@qq.com
 * @LastEditTime: 2023-09-23 16:48:30
 * @FilePath: \checc-business-module-web-kgpt-dev\src\views\examineManage\components\table.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <!--  指标类的列表组件 -->
  <el-table
    :data="tableData"
    style="width: 100%"
    row-key="id"
    border
    @selection-change="onSelect"
    :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  >
    <el-table-column type="selection" width="55" />
    <el-table-column prop="number" label="指标编号"  align="left" />
    <el-table-column prop="name" label="指标名称" />
    <el-table-column prop="indexType_text" label="指标类型" />
    <el-table-column prop="scoreType_text" label="计分类型" />
    <el-table-column prop="scoreMethod" label="评分方式" />
    <el-table-column prop="score" label="指标分数（H）" />
    <el-table-column prop="scoreCompose" label="系统计分组成" />
    <el-table-column prop="indexIntro" label="指标说明" />
    <el-table-column prop="createUsername" label="创建人" />
    <el-table-column prop="createTime" label="创建时间" />
    <el-table-column prop="modifyUsername" label="编辑人" />
    <el-table-column prop="modifyTime" label="编辑时间" />
    <el-table-column prop="address" label="操作">
      <el-button type="primary">编辑</el-button>
    </el-table-column>
  </el-table>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import { ObjectType } from "typings/interfaces";
export default defineComponent({
  components: {},
  emits: {
    selectionChange: null,
  },
  props: {
    tableData: {
      type: Array,
      required: true,
    },
    pagination: {
      type: Object,
    },
  },
  setup(props, { emit }) {
    //表格用到的参数
    const selectedRows = ref<Array<ObjectType>>([]);
    const onSelect = (item) => {
      //选中复选框
      selectedRows.value = item;
      emit("selectionChange", selectedRows.value);
    };
    return {
      onSelect,
    };
  },
});
</script>
<style lang="less" scoped></style>
